#include "Shm.hpp"
#include "namedPipe.hpp"

int main()
{
    //1.创建共享内存    
    Shm shm(gpathname,gproj_id,gUser);
    shm.Zero(); 
    char* addr = (char*)shm.Addr();
    sleep(3);

    //2.打开管道
    NamedPipe fifo(comm_path, User);
    fifo.OpenForWrite();
   
   //当成string
   char ch = 'A';
   while(ch <= 'Z')
   {
       addr[ch - 'A'] = ch;
       std::string temp = "wakeup";
       std::cout << "add " << ch << " into Shm, " << "wake up reader" << std::endl;
       fifo.WriteNamedPipe(temp);
       ch++;
       sleep(2);
   }
    return 0;
}